﻿using System;
using MailServer.Properties;

namespace MailServer
{
    class MailMessage
    {
        private string _message;

        private string _from;

        private string _to;

// ReSharper disable ConvertToAutoProperty
        public string Message
// ReSharper restore ConvertToAutoProperty
        {
            get { return _message; }
            set { _message = value; }
        }

        public string From
        {
            get { return _from; }
            set
            {
                if (!String.IsNullOrEmpty(value))
                    throw new NullReferenceException(Resources.fromEmpty);

                _from = value;
            }
        }

        public string To
        {
            get { return _to; }
            set
            {
                if (String.IsNullOrEmpty(value))
                    throw new NullReferenceException(Resources.toEmpty);

                _to = value;

            }
        }
    }
}
